feat: fall back to LICENSE file#409
Conversation
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com> Co-authored-by: Claude Sonnet <noreply@anthropic.com>
Review Summary by QodoImplement LICENSE file fallback for all package managers with SPDX detection
WalkthroughsDescription• Implement LICENSE file fallback for all package managers • Refactor license utilities into separate module to avoid circular dependencies • Add SPDX detection from LICENSE file content with common license patterns • Update all providers to use fallback mechanism for license detection • Enhance documentation with license detection strategy and SBOM integration Diagramflowchart LR
A["Manifest License"] -->|Present| B["Use Manifest License"]
A -->|Absent| C["Check LICENSE File"]
C -->|Found| D["Detect SPDX Pattern"]
D -->|Match| E["Return SPDX ID"]
D -->|No Match| F["Return First Line"]
C -->|Not Found| G["Return Null"]
B --> H["Include in SBOM"]
E --> H
F --> H
G --> H
File Changes1. src/license/license_utils.js
|
Code Review by Qodo
1. readLicenseFile() may return non-SPDX
|
Description
Detect licenses from the manifest and fallback to
LICENSEfile when not available.Related issues (if any):
Checklist
Additional information
I have also created a
compile:devprofile to generate the map files